var DataTypes = require("sequelize").DataTypes;
var _Order = require("./order");
var _Product = require("./product");
var _Student = require("./student");
var _StudentColor = require("./student_color");
var _User = require("./user");

function initModels(sequelize) {
  var Order = _Order(sequelize, DataTypes);
  var Product = _Product(sequelize, DataTypes);
  var Student = _Student(sequelize, DataTypes);
  var StudentColor = _StudentColor(sequelize, DataTypes);
  var User = _User(sequelize, DataTypes);

  StudentColor.belongsTo(Student, { as: "student", foreignKey: "student_id"});
  Student.hasOne(StudentColor, { as: "student_color", foreignKey: "student_id"});

  return {
    Order,
    Product,
    Student,
    StudentColor,
    User,
  };
}
module.exports = initModels;
module.exports.initModels = initModels;
module.exports.default = initModels;
